import request from '@/utils/request'

// 客户统计
export function countCustom(query) {
	return request({
		url: '/function/customer/customerSearch',
		method: 'get',
		params: query
	})
}

// 查询客户列表
export function listCustom(query) {
	return request({
		url: '/function/customer/customerAll',
		method: 'get',
		params: query
	})
}
// 查询客户列表
export function listCustoms(query) {
	return request({
		url: '/function/customer/list',
		method: 'get',
		params: query
	})
}
// 查询客户列表不分页
export function selectCustom(query) {
	return request({
		url: '/function/customer/listNotPage',
		method: 'get',
		params: query
	})
}

// 查询客户详情
export function getCustom(id) {
	return request({
		url: '/function/customer/companyDetailsById/' + id,
		method: 'get'
	})
}

// 新增客户
export function addCustom(data) {
	return request({
		url: '/function/customer/addCustomerAndContacts',
		method: 'post',
		data: data
	})
}

// 修改客户
export function updateCustom(data) {
	return request({
		url: '/function/customer/editCustomer',
		method: 'put',
		data: data
	})
}

// 删除客户
export function delCustom(id) {
	return request({
		url: '/function/customer/' + id,
		method: 'delete'
	})
}

// 查询日志列表
export function listLog(query) {
	return request({
		url: '/customer/log/list',
		method: 'get',
		params: query
	})
}
// 日志详情
export function logDetail(id) {
	return request({
		url: '/customer/log/' + id,
		method: 'get'
	})
}
// 新增项目日志
export function addLog(data) {
	return request({
		url: '/customer/log',
		method: 'post',
		data: data
	})
}
// 推送日志
export function mailSend(data) {
	return request({
		url: '/customer/log/push/',
		method: 'post',
		data: data
	})
}

// 修改日志
export function updateLog(data) {
	return request({
		url: '/customer/log',
		method: 'put',
		data: data
	})
}
